<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script src="https://unpkg.com/vue@next"></script>
<div id="app">
    <div v-bind:style="{ fontSize: postFontSize + 'em'}">
        <blog-item v-for="post in posts" :title="post.message" :key="post.id" @scalebig="postFontSize += 0.1"></blog-item>
    </div>
</div>

<script>
    const vueOpt = {
        data() {
            return {
                posts: [{id: 1, message: 'aaa'}, {id: 2, message: 'bbb'}],
                postFontSize: 1
            }
        }
    }

    const app = Vue.createApp(vueOpt);
    app.component('blog-item', {
        data() {
            return {

            }
        },
        props: ['title'],
        emits:['scalebig', 'scalesmall'],
        template: `
            <div class="blog-post">
                <h4>{{title}}</h4>
                <button @click="$emit('scalebig')">
                    Enlarge text
                </button>
            </div>
        `
    })

    app.mount('#app');
</script>
</body>
</html>
